package labox.innovation.gameserver.network.gameserverpackets;

import java.io.IOException;

import labox.innovation.config.Config;
import labox.innovation.gameserver.model.FuzeWorld;

/**
 * 发送当前游戏世界中玩家数量到登陆服务器
 * @author
 *
 */
public class PlayerCountsPacket extends GameServerBasePacket{
	
	public PlayerCountsPacket() {
		int currentPlayers = FuzeWorld.getInstance().getAllPlayersCount();
		writeByte(0x07);  //-- 协议
        writeByte(Config.SERVER_ID);  //-- 游戏服ID
        writeInt(currentPlayers);  //-- 当前游戏服上玩家数
        writeInt(Config.MAXIMUM_ONLINE_USERS); //-- 当前游戏服上设置最多玩家数
	}

	@Override
	public byte[] getContent() throws IOException {
		return getBytes();
	}

}
